package com.youxue.service;

import com.youxue.dao.LineDetailMapper;
import com.youxue.entity.LineDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 15c on 2018/1/20.
 */
@Service("linedetail")
public class LineDetailServiceImpl  implements LineDetailService{
    @Autowired
    LineDetailMapper lineDetailMapper;

    @Override
    public List<LineDetail> showALineDetails(Integer lineId) {
        return lineDetailMapper.selectALineDetails(lineId);
    }

    @Override
    public int deleteALineDetail(Integer lineDetailId) {
        return lineDetailMapper.deleteByPrimaryKey(lineDetailId);
    }

    @Override
    public int addALineDetail(LineDetail lineDetail) {
        return lineDetailMapper.insertSelective(lineDetail);
    }

    @Override
    public LineDetail showALineDetail(Integer lineDetailId) {
        return lineDetailMapper.selectByPrimaryKey(lineDetailId);
    }

    @Override
    public int updateALineDetail(LineDetail lineDetail) {
        return lineDetailMapper.updateByPrimaryKeySelective(lineDetail);
    }

    @Override
    public int deleteALineDetailByLineId(Integer lineId) {
        return lineDetailMapper.deleteALineDetailByLineId(lineId);
    }
}
